package com.gxa.domain.dto;

import com.gxa.common.base.BasePage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductQueryDto extends BasePage {
    private String productName;
    private String barcodeNo;
    private Integer firstLevelCategory;
    private Integer secondLevelCategory;
    private Integer pageStartIndex;

    public ProductQueryDto(String productName, String barcodeNo, int firstLevelCategory) {
        this.productName = productName;
        this.barcodeNo = barcodeNo;
        this.firstLevelCategory = firstLevelCategory;
    }

    public Integer getPageStartIndex() {
        return this.pageStartIndex=(this.getPageNo()-1)*this.getPageSize();
    }
}
